/*
** my_put.c for  in /u/all/caille_c/cu/rendu/colles/XXXXXX
** 
** Made by carole cailleux
** Login   <caille_c@epitech.net>
** 
** Started on  Mon Apr 26 19:23:17 2010 carole cailleux
** Last update Mon Apr 26 21:24:05 2010 carole cailleux
*/

#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>

void		my_putchar(char c)
{
  write(1, &c, 1);
}

int		my_strlen(char *str)
{
  int		i;

  i = 0;
  while (str[i])
    i++;
  return (i);
}

void		my_putstr(char *str)
{
  write(1, str, my_strlen(str));
}

void		my_puterror(char *str)
{
  write(2, str, my_strlen(str));
}

int		my_putnbr(int nb)
{
  if (nb < 0)
    {
      nb = nb * (-1);
      my_putchar('-');
    }
  if (nb / 10 > 0)
    my_putnbr(nb / 10);
  my_putchar((nb % 10) + '0');
  return (0);
}

